<!DOCTYPE html>
<html>

<head>

	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>创建后台账号</title>
	<meta name="keywords" content="">
	<meta name="description" content="">
	<link rel="shortcut icon" href="favicon.ico">
	<link href="__STATIC__/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
	<link href="__STATIC__/css/font-awesome.css?v=4.4.0" rel="stylesheet">
	<!-- jqgrid-->
	<link href="__STATIC__/css/plugins/jqgrid/ui.jqgrid.css?0820" rel="stylesheet">
	<link href="__STATIC__/css/style.css?v=4.1.0" rel="stylesheet">
	<link href="__STATIC__/css/tool.css" rel="stylesheet">
	<link rel="stylesheet" type="text/css" href="__STATIC__/css/statistics.css" />
	<link rel="stylesheet" type="text/css" href="__STATIC__/css/information.css" />
	<link rel="stylesheet" type="text/css" href="__STATIC__/css/t_c.css" />
	<link href="__STATIC__/css/animate.css" rel="stylesheet">
	<link href="__STATIC__/css/anchor.css" rel="stylesheet">
	<link href="__STATIC__/css/new_file.css" rel="stylesheet">
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content  animated fadeInRight">
	<div class="row">
		<div class="col-sm-12">
			<div class="ibox ">
				<div class="ibox-title">
					<h5>创建后台账号</h5><!-- <div id= "app"><span v-for="imgItem in aboutData">{{imgItem.title}}</span></div> --><!-- <span id="app">{{message}}</span> -->
				</div>
				<div class="toogl_body">
					<div class="toogl_tale">
						<a href="{:url('account_details')}"><input type="button" value="账号详情" class="btn btn-w-m btn-info"></a>
						<a href="{:url('account_registered')}"><input type="button" value="注册账号" class="btn btn-w-m btn-default"></a>
						<a href="{:url('account_operation')}"><input type="button" value="操作记录" class="btn btn-w-m btn-default"></a>
					</div>
					<div class="ibox-content ibox-conte5">
						<form id="form_1" method="post" enctype="multipart/form-data" role="form" class="form-inline">
							<div class="form-group form-group-wj">
								<label class="test-item">账号：</label>
								<input class="form-control" id="account">
							</div>
							<div class="form-group form-group-wj">
								<label class="test-item">姓名：</label>
								<input class="form-control" id="username">
							</div>
							<!--<div class="form-group form-group-1 form-group-wj">
                                <label class="control-label">选择游戏：</label>
                                <select id="activity_type">
                                    <option value="">请选择游戏</option>
                                    <option value="16842753">宝坻麻将</option>
                                </select>
                            </div>-->
							<div class="form-group form-group-1 form-group-wj">
								<label class="control-label">账号类型：</label>
								<select id="activity_type">
									<option value="">请选择账号类型</option>
									<!-- <option v-for="imgItem in aboutData" value="{{imgItem.id}}">{{imgItem.title}}</option> -->
									<!-- <option value="2">管理员</option> -->
								</select>
							</div>
							<div class="form-group form-group-1 form-group-wj">
								<label class="control-label">状态：</label>
								<select id="status">
									<option value="">请选择状态</option>
									<option value="1">正常</option>
									<option value="0">停用</option>
								</select>
							</div>

							<div class="form-group form-group-wj">
								<input type="button" value="查询" class="btn btn-info" id="buttonid">
							</div>
						</form>
					</div>
					<div class="jqGrid_wrapper">
						<table id="table_list_1"></table>
						<div id="pager_list_1"></div>
					</div>
				</div>
			</div>
		</div>

	</div>
</div>
<!-- 弹出  详情   -->
<div id="myModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div id="gray_Nr">
		<div class="col-sm-4 acco-tc">
			<div class="ibox float-e-margins float-e-margins-xiao">
				<div class="ibox-title">
					<h5>选择区域</h5>
					<div class="ibox-tools" data-dismiss="modal">
						<a class="close-link">
							<i class="fa fa-times"></i>
						</a>
					</div>
				</div>
				<div class="province_bod">
					<div class="province_1" id="province" style="width: 100%">
						<p class="province_top">选择区域</p>
					</div>
				</div>
				<div class="ibox-butz">
					<input class="btn btn-w-m " type="button" id="all" style="background-color:#B4CDCD" value="全选">
					<input class="btn btn-w-m " type="button" id="Uall" style="background-color:#A9A9A9" value="取消全选">
					<input class="btn btn-w-m btn-info" type="button" id="button_ban_user" data-dismiss="modal" value="确定">
					<input class="btn btn-w-m" type="button" data-dismiss="modal" id="cancel" value="取消">
				</div>
			</div>
		</div>
	</div>
</div>
<!-- 弹出  详情   -->
<!-- 弹出  详情   -->
<div id="myModalwfxg" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div id="gray_Nr">
		<div class="col-sm-4 acco-tc">
			<div class="ibox float-e-margins float-e-margins-xiao">
				<div class="ibox-title">
					<h5>选择玩法</h5>
					<div class="ibox-tools" data-dismiss="modal">
						<a class="close-link">
							<i class="fa fa-times"></i>
						</a>
					</div>
				</div>
				<div class="province_bod">
					<div class="province_1" id="game" style="width: 100%">
						<p class="province_top">选择玩法</p>
					</div>
				</div>
				<div class="ibox-butz">
					<input class="btn btn-w-m " type="button" id="alls" style="background-color:#B4CDCD" value="全选">
					<input class="btn btn-w-m " type="button" id="Ualls" style="background-color:#A9A9A9" value="取消全选">
					<input class="btn btn-w-m btn-info" type="button" id="button_ban_users" data-dismiss="modal" value="确定">
					<input class="btn btn-w-m" type="button" data-dismiss="modal" id="cancels" value="取消">
				</div>
			</div>
		</div>
	</div>
</div>
<!-- 弹出  详情   -->
<div id="myModal2" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div id="gray_Nr">
		<div class="col-sm-4 acco-tc">
			<div class="ibox float-e-margins float-e-margins-xiao">
				<div class="ibox-title">
					<h5>所属地区</h5>
					<div class="ibox-tools" data-dismiss="modal">
						<a class="close-link">
							<i class="fa fa-times"></i>
						</a>
					</div>
				</div>
				<div class="province_bod">
					<div class="province_1" id="province_area" style="width: 100%">
						<p class="province_top">所属地区</p>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<!--账号详情修改-->
<!-- 弹出  详情   -->
<div id="myModalwf" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div id="gray_Nrs">
		<div class="col-sm-4 acco-tc">
			<div class="ibox float-e-margins float-e-margins-xiao">
				<div class="ibox-title">
					<h5>玩法</h5>
					<div class="ibox-tools" data-dismiss="modal">
						<a class="close-link">
							<i class="fa fa-times"></i>
						</a>
					</div>
				</div>
				<div class="province_bod">
					<div class="province_1" id="province_game" style="width: 100%">
						<p class="province_top">玩法</p>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<!--账号详情修改-->
<div id="acc-tc" class="acc-tc">
	<div id="acc-nr">
		<div class="col-sm-12">
			<div class="ibox float-e-margins float-e-margins-2" style="min-width: 1200px">
				<div class="ibox-title">
					<h5>选择游戏</h5>
					<div class="ibox-tools" data-dismiss="modal">
						<a class="close-link btn-qx">
							<i class="fa fa-times"></i>
						</a>
					</div>
				</div>
				<div class="wrapper wrapper-content  animated fadeInRight">
					<div class="row">
						<div class="col-sm-12">
							<div class="ibox ">
								<div class="toogl_body">
									<div class="ibox-content jqGrid_wrapp_qx">
										<div class="form-inlin2 form-inlin3">
											<div class="form-group form-group-tool">
												<input type="hidden" id="getId" value="" />
												<input type="hidden" id="action_object" value="" />
												<label class="recor-red">*</label>
												<label class="control-label">账号：</label>
												<input type="text" placeholder="请输入账号" id="xgAccount" class="form-control">
											</div>
											<div class="form-group form-group-tool">
												<label class="recor-red">*</label>
												<label class="control-label">姓名：</label>
												<input type="text" placeholder="请输入姓名" id="xgName" class="form-control">
											</div>
											<div class="form-group form-group-tool">
												<label class="recor-red">*</label>
												<label class="control-label">手机号：</label>
												<input type="text" placeholder="手机号" id="xgPhone" class="form-control" onkeyup="this.value=this.value.replace(/\D/g,'')">
											</div>
											<div class="form-group form-group-1 form-group-0 form-grouzj">
												<label class="control-label">　账号类型：</label>
												<select id="con_1">
												</select>
											</div>
										</div>
										<div class="form-inlin2 form-inlin3">
											<div id="form_fd" class="form-group form-group-0">
												<input type="hidden" id="area_id">
												<input type="button" value=" 选择区域 " class="btn btn-info" data-toggle="modal" data-target="#myModal" id="form_game" style="width: 100%;">
											</div>　
											<div id="form_fds" class="form-group form-group-0">
												<input type="hidden" id="play_id">
												<input type="button" value=" 选择玩法 " class="btn btn-info" data-toggle="modal" data-target="#myModalwfxg" id="form_games" style="width: 100%;">
											</div>
										</div>
									</div>
									<div class="ibox-content">

									</div>
								</div>
							</div>
						</div>
					</div>
					<div class="ibox-butz">
						<input class="btn btn-w-m btn-info" type="button" id="button_ban_user" onclick="_modificationClick()" value="确定">
						<input class="btn btn-w-m btn-qx" type="button"  value="取消">
					</div>
				</div>
			</div>

		</div>
	</div>
</div>
<!--账号详情修改-->
<!-- 冻结   -->
<div id="myModal3" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div id="gray_Nr">
		<div class="col-sm-6">
			<div class="ibox float-e-margins float-e-margins-2">
				<div class="ibox-title">
					<h5>提示消息</h5>
					<div class="ibox-tools" data-dismiss="modal">
						<a class="close-link">
							<i class="fa fa-times"></i>
						</a>
					</div>
				</div>
				<div class="panel-body">
					<div class="ibox float-e-margins float-e-border">
						<div class="ibox-content">
							<form class="form-horizontal">
								<input type="hidden" name="" id="Club_dissolution_id">
								<input type="hidden" name="" id="Club_dissolution_name">
								<div class="form-texcan">确定删除？</div>
							</form>
						</div>
					</div>
				</div>
				<div class="ibox-butz">
					<input class="btn btn-w-m btn-info" type="button" value="確定" onclick="del()">
					<input class="btn btn-w-m" type="button" data-dismiss="modal" value="取消">
				</div>
			</div>
		</div>
	</div>
</div>
<!--手机导航-->
<div class="to-fdh" style="display: none;">
	<img class="to-imgd" src="__STATIC__/img/phonedh.jpg">
	<div class="mob-nrlb">
		<ul>
			<li>
				<a class="mob-nrdh">管理</a>
				<ul class="mob-nryc">
					<li class="mob-nrdhli">
						<a href="{:url('Player/gameplayer')}">玩家管理</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('system/notice')}">公告管理</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('email/mail')}">邮件管理</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('Club/club')}">亲友圈管理</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('Money/money')}">提现管理</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('Order/order')}">订单管理</a>
					</li>
				</ul>
			</li>
			<li>
				<a class="mob-nrdh">数据</a>
				<ul class="mob-nryc">
					<li class="mob-nrdhli">
						<a href="{:url('data/datagk')}">概況</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('data/datawf')}">玩法</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('data/datalc')}">留存</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('data/datass')}">实时数据</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('data/dataczfx')}">充值分析</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('data/dataclub')}">亲友圈统计</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('data/president')}">高级会长</a>
					</li>
				</ul>
			</li>
			<li>
				<a class="mob-nrdh mob-qbh">权限</a>
				<ul class="mob-nryc">
					<li class="mob-nrdhli">
						<a href="{:url('rule/rule_list')}">权限管理</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('rule/rule_group')}">用户组管理</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('account/account_details')}">后台账号管理</a>
					</li>
				</ul>
			</li>
		</ul>
	</div>
</div>
<div class="vnl-zz" style="display:none">
	<div><img src="__STATIC__/img/bqhp.gif"></div>
</div>
<!--手机适配-->
<script src="__STATIC__/js/jquery.min.js?v=2.1.4"></script>
<script src="__STATIC__/js/bootstrap.min.js?v=3.3.6"></script>
<script src="__STATIC__/js/content.js?v=1.0.0"></script>
<script src="__STATIC__/js/plugins/validate/jquery.validate.min.js"></script>
<script src="__STATIC__/js/plugins/validate/messages_zh.min.js"></script>
<!--<script src="__STATIC__/js/demo/form-validate-demo.js"></script>-->
<script src="__STATIC__/js/plugins/jqgrid/i18n/grid.locale-cn.js?0820"></script>
<script src="__STATIC__/js/plugins/jqgrid/jquery.jqGrid.min.js?0820"></script>
<script src="__STATIC__/js/plugins/peity/jquery.peity.min.js"></script>
<script src="__STATIC__/js/plugins/laydate/laydate.js"></script>
<script src="__STATIC__/js/echarts.min.js"></script>
<script>
    //手机适配
    $(function(){
        if ((navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))) {
            $("head").append("<link>");
            var css = $("head").children(":last");
            css.attr({
                rel:  "stylesheet",
                type: "text/css",
                href: "__STATIC__/css/phone_sp.css"
            });
            var mql = window.matchMedia("(orientation: portrait)");
            if(mql.matches) { //竖屏样式
                $(".vnl-zz").show();
                $(".to-fdh").hide();
            }else{
                $(".to-fdh").show();
                $("html").width("100%");
                $("body").width("100%");
            }
            mql.addListener(function(m) {
                if(m.matches) {
                    // 改变到直立方向
                    $(".vnl-zz").show();
                    $(".to-fdh").hide();
                }
                else {
                    $(".to-fdh").show();
                    $(".vnl-zz").hide();
                    $("html").width("100%");
                    $("body").width("100%");
                }
            });
        }
    });
    //导航显示展开
    $(".mob-nrdh").click(function(){
        $(this).next().toggle(".mob-nryc");
    });
    $(".to-imgd").click(function(){
        $(this).next().toggle(".mob-nrlb");
    });
    //手机适配end
    $(".btn-qx").click(function(){
        $(".acc-tc").hide();
    })
    //地区
    $(function() {
        $.ajax({
            type: "post",
            url: "{:url('club/area')}",
            data: {},
            dataType: "json",
            success: function(e) {
                console.log(e);
                for(i in e) {
                    $("#province").append( "<p class='province_nr pre_n1'><span>"+e[i].area_name+"</span><input type='checkbox' class='fa province_jt bxd_chox area' name='area' value='"+e[i].aid+"'></p>");

                }
            },
            error: function(e) {
                console.log(e);
            }
        });
    });
    //游戏
    $(function() {
        $.ajax({
            type: "post",
            url: "{:url('account/Game')}",
            data: {},
            dataType: "json",
            success: function(e) {
                console.log(e);
                for(i in e) {
                    $("#game").append( "<p class='province_nr pre_n1'><span>"+e[i].name+"</span><input type='checkbox' class='fa province_jt bxd_chox play' name='game' value='"+e[i].id+"'></p>");

                }
            },
            error: function(e) {
                console.log(e);
            }
        });
    });
    //获取账号类型
    $(function() {
        $.ajax({
            type: "post",
            url: "__URL__/account_type",
            data: {
            },
            dataType: "json",
            success: function(e) {
                console.log(e);
                for(i in e)
                {
                    $("#activity_type").append("<option value='"+e[i].id+"'>"+e[i].title+"</option>");
                    $("#con_1").append("<option value='"+e[i].id+"'>"+e[i].title+"</option>");
                }
            },
            error: function(e) {
                console.log(e);
            }
        });
    });
    function area(t) {
        var id = $(t).parent().parent().children().eq(0).html();//ID
        $("#province_area").html("");
        // console.log(id);
        $.ajax({
            type: "post",
            url: "{:url('club/Own_area')}",
            data: {"id":id},
            dataType: "json",
            success: function(e) {
                // console.log(e);
                for(i in e) {
                    $("#province_area").append( "<p class='province_nr pre_n1'><span>"+e[i]+"</span></p>");

                }
            },
            error: function(e) {
                console.log(e);
            }
        });
    }
    function game(t) {
        var id = $(t).parent().parent().children().eq(0).html();//ID
        $("#province_game").html("");
        // console.log(id);
        $.ajax({
            type: "post",
            url: "{:url('account/Own_game')}",
            data: {"id":id},
            dataType: "json",
            success: function(e) {
                // console.log(e);
                for(i in e) {
                    $("#province_game").append( "<p class='province_nr pre_n1'><span>"+e[i]+"</span></p>");

                }
            },
            error: function(e) {
                console.log(e);
            }
        });
    }
    //时间戳转换
    function UnixToDate(unixTime, isFull, timeZone) {
        if (typeof (timeZone) == 'number'){
            unixTime = parseInt(unixTime) + parseInt(timeZone) * 60 * 60;
        }
        var time = new Date(unixTime * 1000);
        var ymdhis = "";
        ymdhis += time.getUTCFullYear() + "-";
        ymdhis += (time.getUTCMonth()+1) + "-";
        ymdhis += time.getUTCDate();
        if (isFull === true){
            ymdhis += " " + time.getUTCHours() + ":";
            ymdhis += time.getUTCMinutes() + ":";
            ymdhis += time.getUTCSeconds();
        }
        return ymdhis;
    }
    $("#form_game").click(function() {
        var area =  $("#area_id").val();
        var area = area.split(",");

        $("input[type=checkbox].area").each(function() {
            for (i in area){
                // console.log($(this).val() );
                if($(this).val() == area[i]){
                    $(this).prop('checked', true);
                }
            }
        });
    });
    $("#form_games").click(function() {
        var game =  $("#play_id").val();
        var game = game.split(",");
		// console.log(game);
        $("input[type=checkbox].play").each(function() {
            for (i in game){
                // console.log($(this).val() );
                if($(this).val() == game[i]){
                    $(this).prop('checked', true);
                }
            }
        });
    });
    function _getMessage(t) {
        $('input:checkbox').prop('checked', false);
        var id = $(t).parent().parent().children().eq(0).html();//ID
        var account = $(t).parent().parent().children().eq(1).html();//账号
        var username = $(t).parent().parent().children().eq(2).html();//姓名
        var phone = $(t).parent().parent().children().eq(3).html();//手机号
        var type = $(t).parent().parent().children().eq(8).html();//账号类型
        var area_id = $(t).parent().parent().children().eq(9).html();//账号类型
        var play_id = $(t).parent().parent().children().eq(11).html();//账号类型
        var status = $(t).parent().parent().children().eq(7).html();//账号状态
        $("#getId").val(id);
        $("#xgAccount").val(account);
        $("#xgName").val(username);
        $("#xgPhone").val(phone);
        $("#action_object").val(username);
        $("#area_id").val(area_id);
        $("#play_id").val(play_id);


        // console.log($("#con_1").val());
        // var con = $("#con_1").val();
        // if(type == con){
        var con_1= $('#con_1').val(type);
        con_1.attr("selected", "selected");
        // }

        $(".acc-tc").show();
        $(".acc-tc").show();

    }
    function _get(t) {
        $('input:checkbox').prop('checked', false);
        var id = $(t).parent().parent().children().eq(0).html();//ID
        var account = $(t).parent().parent().children().eq(1).html();//账号
        var username = $(t).parent().parent().children().eq(2).html();//姓名
        var phone = $(t).parent().parent().children().eq(3).html();//手机号
        var type = $(t).parent().parent().children().eq(8).html();//账号类型
        var area_id = $(t).parent().parent().children().eq(9).html();//账号类型
        var status = $(t).parent().parent().children().eq(7).html();//账号状态
        var play_id = $(t).parent().parent().children().eq(11).html();//账号类型
        $("#getId").val(id);
        $("#xgAccount").val(account);
        $("#xgName").val(username);
        $("#xgPhone").val(phone);
        $("#action_object").val(username);
        $("#area_id").val(area_id);
        $("#play_id").val(play_id);
		// console.log(id);
    }
    $("#all").click(function() {
        $("input[type=checkbox].area").each(function() {
            // if(this.checked == true){
            //     $(this).prop('checked', false);
            // }else{
            $(this).prop('checked', true);
            // }

        });

    });
    $("#Uall").click(function() {
        $("input[type=checkbox].area").each(function() {
            $(this).prop('checked', false);

        });

    });
    $("#alls").click(function() {
        $("input[type=checkbox].play").each(function() {
            // if(this.checked == true){
            //     $(this).prop('checked', false);
            // }else{
            $(this).prop('checked', true);
            // }

        });

    });
    $("#Ualls").click(function() {
        $("input[type=checkbox].play").each(function() {
            $(this).prop('checked', false);

        });

    });
    //修改
    function _modificationClick() {
        var arr = new Array();
        $("input[type=checkbox].area").each(function() {
            if($(this).prop("checked") == true){
                arr.push($(this).val());
            }
        });
        var game = new Array();
        $("input[type=checkbox].play").each(function() {
            if($(this).prop("checked") == true){
                game.push($(this).val());
            }
        });
        console.log(arr);
        $.ajax({
            type: "post",
            url: "__URL__/account_modify",
            data: {
                "guid": $("#getId").val(),
                'data':arr,
                'game':game,
                "account": $("#xgAccount").val(), //账号
                "username": $("#xgName").val(), //姓名
                "phone": $("#xgPhone").val(), //手机号
                "type": $("#con_1").val(), //账号类型
                'object_name': $("#action_object").val(), //操作对象
            },
            dataType: "json",
            success: function(e) {
                console.log(e);
                $("#myModal2").modal("hide");
                alert(e.msg);
                location.reload();
            },
            error: function(e) {
                console.log(e);
            }
        });
    }
    //删除
    function del() {

        $.ajax({
            type: "post",
            url: "__URL__/del",
            data: {
                "guid": $("#getId").val(),

            },
            dataType: "json",
            success: function(e) {
                console.log(e);
                alert(e.msg);
                location.reload();
            },
            error: function(e) {
                console.log(e);
            }
        });
    }
    //状态 禁用
    function account_disable(t,s) {
        var id = $(t).parent().parent().children().eq(0).html();//ID
        var object_name = $(t).parent().parent().children().eq(2).html();//ID
        $.ajax({
            type: "post",
            url: "__URL__/account_disable",
            data: {
                "guid": id,
                'status':s,
                'object_name':object_name
            },
            dataType: "json",
            success: function(e) {
                console.log(e);
                alert(e.msg);
                location.reload();
            },
            error: function(e) {
                console.log(e);
            }
        });
    }
    //账号 启用
    function account_Enable(t,s){
        var id = $(t).parent().parent().children().eq(0).html();//ID
        var object_name = $(t).parent().parent().children().eq(2).html();//ID
        $.ajax({
            type: "post",
            url: "__URL__/account_Enable",
            data: {
                "guid": id,
                'status':s,
                'object_name':object_name
            },
            dataType: "json",
            success: function(e) {
                console.log(e);
                alert(e.msg);
                location.reload();
            },
            error: function(e) {
                console.log(e);
            }
        });
    }

    //选择游戏的操作
    $('.pre_n1').click(function() {
        $('.pre_n1').css('background', '#fff');
        $('.pre_n1').css('color', '#6f6f6f');
        $(this).css('background', '#19a9d5');
        $(this).css('color', '#fff');
    });
    $('.pre_n2').click(function() {
        $('.pre_n2').css('background', '#fff');
        $('.pre_n2').css('color', '#6f6f6f');
        $(this).css('background', '#19a9d5');
        $(this).css('color', '#fff');
    });
    $('.pre_n3').click(function() {
        $('.pre_n3').css('background', '#fff');
        $('.pre_n3').css('color', '#6f6f6f');
        $(this).css('background', '#19a9d5');
        $(this).css('color', '#fff');
    });
    $(".form-tc_f").hide();
    $("#form_fd").mousemove(function() {
        $(".form-tc_f").show();
    });
    $("#form_fd").mouseout(function() {
        $(".form-tc_f").hide();
    });
    $("#btn_qx").click(function() {
        $("#tab-1 :checkbox").prop("checked", "true")
    })


    $(".game_tc").click(function() {
        $(".game_t").css("display", "block");
    });
    $(".game_g").click(function() {
        $(".game_t").css("display", "none");
    });
    $('#buttonid').on('click', function() {     //页面上的button按钮的click事件，重新获取参数后发送参数，然后重新加载数据。
        var username = $("#username").val();
        var account = $("#account").val();
        var status = $("#status").val();
        var type = $("#activity_type").val();

        $("#table_list_1").jqGrid('setGridParam',{
            url:'__URL__/account_information',
            datatype:'json',
            postData:{'username':username,'account':account,'status':status,'type':type},
            page:1
        }).trigger("reloadGrid"); //重新载入

    });
    $(document).ready(function() {
        $.jgrid.defaults.styleUI = 'Bootstrap';
        $("#table_list_1").jqGrid({
            url:"__URL__/account_information",
            datatype:'json',
            postData:{}, //发送数据
            mtype: 'POST',
            autowidth: true,
            shrinkToFit: true,
            rowNum: 20,
            height:500,
            rowList: [20, 50, 100],
            colNames: ['用户id','账号', '姓名', '手机号', '账号类型', '最后登录时间','登录IP地址', '状态','type','area','地区','game','玩法','修改','操作'],
            colModel: [
                {
                    name: 'id',
                    index: 'id',
                    align:'center',
                },
                {
                    name: 'account',
                    index: 'account',
                    align:'center',
                },
                {
                    name: 'username',
                    index: 'username',
                    align:'center',
                }, {
                    name: 'phone',
                    index: 'phone',
                    align:'center',
                },
                {
                    name: 'type_name',
                    index: 'type_name',
                    align:'center',
                },
                {
                    name: 'last_login_time',
                    index: 'last_login_time',
                    align:'center',
                },
                {
                    name: 'last_login_ip',
                    index: 'last_login_ip',
                    align:'center',
                },
                {
                    name: 'status',
                    align:'center',
                    index: 'status',
                    formatter:function(status){
                        switch(Number(status)){
                            case 0:
                                return '<span style="color:#d89200"><b>禁用</b></span>';
                            case 1:
                                return '<span style="color:#1ac91a"><b>正常</b></span>';
                        }
                    }
                },
                {
                    name: 'type',
                    index: 'type',
                    align:'center',
                    hidden:true
                },
                {
                    name: 'area_id',
                    align:'center',
                    index: 'area_id',
                    hidden:true
                },
                {
                    name: 'id',
                    index: 'id',
                    formatter: function(id) {
                        return '<input type="button" value="所属地区" class="btn btn-info" data-toggle="modal" data-target="#myModal2" onclick="area(this)">';
                    },
                    align:'center'
                },
                {
                    name: 'play_id',
                    align:'center',
                    index: 'play_id',
                    hidden:true
                },
                {
                    name: 'id',
                    index: 'id',
                    formatter: function(id) {
                        return '<input type="button" value="详情" class="btn btn-info" data-toggle="modal" data-target="#myModalwf" onclick="game(this)">';
                    },
                    align:'center'
                },
                {
                    name: 'status',
                    align:'center',
                    index: 'status',
                    formatter:function(){

                        return '<input type="button" data-toggle="modal" data-target="#myModal3" class="btn btn-danger" onclick="_get(this)" style="background:red;border:1px solid red" value="删除" /><input type="button"  onclick="_getMessage(this)" value="修改" class="btn btn-info"/>';
                    }
                },
                {
                    name: 'status',
                    index: 'status',
                    align:'center',
                    formatter:function(status){
                        switch(Number(status)){
                            case 0:
                                return '<input type="button" onclick="account_Enable(this,1)"  data-status="1" value="启用" class="btn btn-info"/>';
                            case 1:
                                return '<input type="button" onclick="account_disable(this,0)"  data-status="0" style="background:red;border:1px solid red"  value="禁用" class="btn btn-info"/>';
                        }

                    }
                }
            ],
            pager: "#pager_list_1",
            loadonce: true,
            viewrecords: true,
            hidegrid: false,
            gridstate: 'hidden'
        });
        $(window).bind('resize', function() {
            var width = $('.jqGrid_wrapper').width();
            $('#table_list_1').setGridWidth(width);
        });

        //				$("#Enable").click(function() {
        //					if($("#Enable").val() == '禁用') {
        //						$("#Enable").val("启用");
        //						$("#Enable").css("background", "#23b7e5");
        //						$("#Enable").css("border", "1px solid #23b7e5");
        //					} else if($("#Enable").val() == '启用') {
        //						$("#Enable").val("禁用");
        //						$("#Enable").css("background", "red");
        //						$("#Enable").css("border", "1px solid red");
        //					}
        //				});
    });
</script>

</body>

</html>